|
|
|
|
|
|
|
form. After completing these routines, you might want to modify the library functions to add additional features and options that suit your particular data entry needs. |
|
|
|
|
|
|
|
|
For each data entry form you design using these routines, you need to stay within the following guidelines: |
|
|
|
|
|
|
|
|
· Each data entry form corresponds to a single dataset. Following this guideline is easy when you are dealing with table-type datasets. You can design a single form for each table. If you need to perform data entry on a set of columns that are the result of a multiple-table SQL JOIN operation, you can use the dataset produced by the JOIN as the basis for the data entry form. |
|
|
|
|
|
|
|
|
· Each data entry form contains a single command button named cmdBtn. You must set its Index property to 0 to indicate that it is part of a control array. All the routines you build expect this command button. |
|
|
|
|
|
|
|
|
· Every column in the dataset row that requires data entry is represented by a single textbox control on the form. The control and the field are related by placing the column name in the Tag property of the input control. This procedure enables you to bind your input controls to your dataset. |
|
|
|
|
|
|
|
|
After incorporating these guidelines, you can lay out your forms in any manner you like. |
|
|
|
|
|
|
|
|
Begin this project by building the library of record-handling functions. Start a new Visual Basic 5.0 ActiveX DLL project. Set the class name to recObject by filling the Name property of the class module. |
|
|
|
|
| |
|
|
|
|
Be sure to set the Option Explicit option to On for this project. This option forces you to declare all variables before they are used in your program. Using the Option Explicit setting helps reduce the number of program bugs you create as you enter these routines. |
|
|
|
|
|
|
|
|
|
|
Before you begin the heavy coding, complete the declaration section of the library routine. Enter Listing 10.6 at the top of the module. |
|
|
|
|
|
|
|
|
Listing 10.6. Coding the global variables. |
|
|
|
|
|
|
|
|
Option Explicit
'
' local enumerations
' recordset types
Enum rsType |
|
|
|
|
|